package com.ocom.wxapi.controller;

import cn.hutool.core.util.ObjectUtil;
import com.ocom.common.constant.WebApiServiceUrl;
import com.ocom.common.request.payconfig.GetTollPointInfoRequest;
import com.ocom.common.request.web.TollPointPageOnShowRequest;
import com.ocom.common.resp.Result;
import com.ocom.wxapi.client.PayConfigClientService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

@RestController
public class TollPointPageController {
    @Autowired
    PayConfigClientService payConfigClientService;

    @PostMapping("/TollPointPage/onShow")
    public Result TollPointPageOnShow(@Valid TollPointPageOnShowRequest request){
        GetTollPointInfoRequest request1=new GetTollPointInfoRequest();
        request1.setCom_id(request.getComId());
        if(ObjectUtil.isEmpty(request.getMerchId())){
            request1.setMerch_id(-1);
        }
        request1.setPoint_name(request.getPointName());
        request1.setPage(request.getPage());
        request1.setSize(request.getSize());
        //	System.out.println(request1);
        return payConfigClientService.getTollPointInfo(request1);
    }
}
